package com.qys.livesMall.shortVideo.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qys.livesMall.app.user.model.dto.AppBaseDTO;
import com.qys.livesMall.framework.view.BaseQuery;
import com.qys.livesMall.shop.modal.entity.ShopGoodsInfo;
import com.qys.livesMall.shortVideo.model.dto.ShortVideoEventDTO;
import com.qys.livesMall.shortVideo.model.dto.app.AppShortVideoPageDTO;
import com.qys.livesMall.shortVideo.model.dto.app.AppShortVideoSaveDTO;
import com.qys.livesMall.shortVideo.model.dto.sys.SysShortVideoQueryDTO;
import com.qys.livesMall.shortVideo.model.dto.sys.SysShortVideoSaveDTO;
import com.qys.livesMall.shortVideo.model.entity.H2ShortVideo;
import com.qys.livesMall.shortVideo.model.vo.app.*;
import com.qys.livesMall.shortVideo.model.vo.sys.SysShortVideoVO;

import java.util.List;

/**
 * <p>
 * 短视频信息 服务类
 * </p>
 *
 * @author dp
 * @since 2023-05-04
 */
public interface IH2ShortVideoService extends IService<H2ShortVideo> {

    /**
     * 后台管理分页查询短视频信息
     *
     * @param sysShortVideoQueryDTO
     * @return
     */
    Page<SysShortVideoVO> pageBySystem(SysShortVideoQueryDTO sysShortVideoQueryDTO);

    /**
     * 保存短视频信息
     *
     * @param videoSaveDTO
     */
    void saveVideoBySystem(SysShortVideoSaveDTO videoSaveDTO);

    /**
     * 用户上传短视频信息
     *
     * @param shortVideoSaveDTO
     */
    void saveVideoByApp(AppShortVideoSaveDTO shortVideoSaveDTO);

    /**
     * app获取短视频信息
     *
     * @return
     */
    AppShortVideoVO getShortVideoByApp();

    /**
     * 用户转发视频
     *
     * @param videoId
     */
    void forwardVideo(String videoId);

    /**
     * 用户点赞/查看/收藏/转发次数修改
     *
     * @param eventDTO
     */
    void incrementVideo(ShortVideoEventDTO eventDTO);

    /**
     * 根据id查询短视频信息
     *
     * @param id      短视频id
     * @param history 是否从浏览历史记录跳转
     */
    AppShortVideoVO getShortVideoById(Long id, Byte history);

    /**
     * 用发布短视频查询
     *
     * @param baseQuery {@link  BaseQuery}
     */
    Page<AppShortVideoVO> pageByApp(BaseQuery baseQuery);

    AppShortVideoVO getFollowUserShortVideo();

    /**
     * 判断是否是店主
     * @param userId 用户ID
     * @return
     */
    boolean hasShop(Long userId);

    /**
     * 分页查询视频绑定商品
     * @param baseQuery
     * @return
     */
    IPage<ShopGoodsInfo> getShopGoodsInfoByVideo(BaseQuery baseQuery);

    List<QuerykeywordsVO> querykeywords(String keywords);

    Page<AppUserCollectionLikeVO> recommendedPage(AppShortVideoPageDTO queryDTO);

    IPage<LikedVideoVO> queryTheListOfLikedVideos(AppBaseDTO dto);

    IPage<CommentVideoVO> queryTheListOfCommentVideos(AppBaseDTO dto);

    IPage<CommentVideoVO> viewCommentsBasedOnVideoId(Long videoId, AppBaseDTO dto);
}
